var echartsUtil = {
  passRate: function(data) {
    var myChart = echarts.init(document.getElementById('main'));
    var option = {
      title: {
        text: '各试卷及格率',
        subtext: 'Fake Data',
        left: 'center'
      },
      tooltip: {
        trigger: 'item'
      },
      // legend: {
      //   orient: 'vertical',
      //   left: 'left'
      // },
      series: [{
        name: 'Access From',
        type: 'pie',
        radius: '50%',
        data: data.passRateList,
        emphasis: {
          itemStyle: {
            shadowBlur: 10,
            shadowOffsetX: 0,
            shadowColor: 'rgba(0, 0, 0, 0.5)'
          }
        }
      }]
    };

    myChart.setOption(option);
  }
}

export default echartsUtil;
